PHREEQC from Scratch #5: Mixing Groundwater and Seawater (Mixing Corrosion)

Simulate ‘mixing corrosion’—where mixing two calcite-saturated waters creates an undersaturated solution. We calculate the mixing of 70% carbonate groundwater and 30% seawater in 5 steps, exploring the kinetic constraints of dolomite.
Geochemistry
PHREEQC
Groundwater
Tutorial
English
Author

DeepFlow

Published

April 11, 2026

What is Mixing Corrosion?

“When two waters, both initially in equilibrium with calcite, are mixed together, the resulting mixture becomes undersaturated with respect to calcite.” — This phenomenon is known as Mixing Corrosion (or Freshwater-Seawater Mixing Dissolution).

This counter-intuitive effect arises from the non-linear nature of carbonate equilibria. Parameters like pH and ionic strength do not average linearly when solutions are mixed.

Why is it Counter-Intuitive?
Since both the groundwater and the seawater are nearly at equilibrium with calcite (SI ≈ 0), one might assume their mixture would also have an SI ≈ 0. However, because the solubility product of the carbonate system depends non-linearly on temperature, ionic strength, and partial pressure of CO₂, the Saturation Index (SI) of the mixture dips below the weighted average of the two end-members.

This phenomenon is geologically significant as it causes calcite dissolution in coastal limestone aquifers and mixing zones. It is a primary driver in the formation of coastal karst caves.


The 5 Steps of Calculation

Our simulation is structured into 5 distinct steps, referred to as S1 through S5.

S1
Define Carbonate Groundwater
Equilibrate pure water with Pco₂ = 10⁻² atm and Calcite → Save Solution 1
S2
Define Seawater
Input the seawater data from Part 2 → Save Solution 2
S3
Mix 70% Groundwater + 30% Seawater
Use the MIX block to specify the ratio → Save Solution 3
S4
Equilibrate Mixture with Calcite + Dolomite
USE solution 3 → EQUILIBRIUM_PHASES (Ideal thermodynamic case)
S5
Equilibrate Mixture with Calcite Only
Exclude Dolomite due to its slow reaction kinetics (Realistic case)

S1: Define Carbonate Groundwater

We define the groundwater of a limestone region by equilibrating pure water with calcite at \(P_{CO_2} = 10^{-2}\) atm. This is similar to the “Open System” in Part 4, but with a slightly higher CO₂ pressure typical of deep soil.

SOLUTION 1  Carbonate groundwater
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    CO2(g)   -2.0   10   # Pco2 = 10^-2 atm
    Calcite   0.0   10   # Equilibrate with Calcite

SAVE solution 1          # Save calculation result

END
NoteCharacteristics of the Generated Groundwater

After this calculation, the groundwater will be saturated with calcium (pH ≈ 7.0, \(\mathrm{Ca^{2+}}\) ≈ 3 to 4 mmol/kg). Verify in the Output that the Calcite SI = 0 (equilibrium).


S2: Define Seawater

We will reuse the seawater composition data from Part 2 (Speciation).

SOLUTION 2  Seawater
    temp      25
    pH        8.22
    pe        8.451
    redox     pe
    units     ppm
    density   1.023
    Ca        412.3
    Alkalinity 141.682  as HCO3-
    Cl        19353
    K         399.1
    Mg        1291.8
    S(6)      2712
    Si        4.28      as SiO2
    Na        10768
    -water    1 # kg

SAVE solution 2

END

S3: Mix 70% Groundwater + 30% Seawater

We use the MIX block to physically mix the two solutions.

GUI Procedure

  1. Click the MIX icon.
  2. Enter 0.70 for SOLUTION 1 and 0.30 for SOLUTION 2.
  3. Add SAVE solution 3 and END to store the mixed state.
MIX 1
    1    0.70   # 70% Solution 1 (Groundwater)
    2    0.30   # 30% Solution 2 (Seawater)

SAVE solution 3

END
ImportantNote on the MIX Block

The values in the MIX block represent mixing fractions (0 to 1). Ensure they sum to exactly 1.0. If they do not, PHREEQC will still run, but the total mass of water in the mixture will be altered.


S4: Equilibrate Mixture with Calcite + Dolomite

Here, we equilibrate the resulting mixture (Solution 3) with both calcite and dolomite (\(\mathrm{CaMg(CO_3)_2}\)).

USE solution 3

EQUILIBRIUM_PHASES 2
    Calcite   0.0   10   # Equilibrate with Calcite
    Dolomite  0.0   10   # Equilibrate with Dolomite (Ideal Case)

END

S5: Equilibrate Mixture with Calcite Only (Realistic Case)

Because dolomite has extremely slow precipitation kinetics at low temperatures, it generally does not precipitate on the short timescales of groundwater mixing. Thus, equilibrating with calcite only provides a more realistic scenario.

USE solution 3

EQUILIBRIUM_PHASES 3
    Calcite   0.0   10   # Equilibrate with Calcite only (No Dolomite)

END
NoteThe Dolomite Problem

Thermodynamically, dolomite is supersaturated in many modern groundwaters and seawaters, yet it almost never precipitates directly in near-surface environments today. This is a classic geochemical enigma known as the “Dolomite Problem,” caused by kinetic barriers. By comparing S4 (ideal thermodynamic equilibrium) and S5 (kinetic constraint applied), we can observe the impact of this phenomenon.


Full PHREEQC Code

# =============================================
# S1: Carbonate Groundwater
# Pure water + CO2(g) at Pco2=10^-2 + Calcite
# =============================================
SOLUTION 1  Carbonate groundwater
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    CO2(g)   -2.0   10
    Calcite   0.0   10

SAVE solution 1
END

# =============================================
# S2: Seawater
# =============================================
SOLUTION 2  Seawater
    temp      25
    pH        8.22
    pe        8.451
    redox     pe
    units     ppm
    density   1.023
    Ca        412.3
    Alkalinity 141.682  as HCO3-
    Cl        19353
    K         399.1
    Mg        1291.8
    S(6)      2712
    Si        4.28      as SiO2
    Na        10768
    -water    1 # kg

SAVE solution 2
END

# =============================================
# S3: Mix 70% Groundwater + 30% Seawater
# =============================================
MIX 1
    1    0.70
    2    0.30

SAVE solution 3
END

# =============================================
# S4: Mixture + Calcite + Dolomite (Ideal Case)
# =============================================
USE solution 3

EQUILIBRIUM_PHASES 2
    Calcite   0.0   10
    Dolomite  0.0   10

END

# =============================================
# S5: Mixture + Calcite Only (Realistic Case)
# =============================================
USE solution 3

EQUILIBRIUM_PHASES 3
    Calcite   0.0   10

END

Reading the Results

Review the pH, \(\mathrm{Ca^{2+}}\), \(\mathrm{Mg^{2+}}\), Calcite SI, and Dolomite SI after each step.

You can also paste the following code in the SOLUTION 1 to verify the ex5.txt file. However, to get familiar with the output data file, it’s highly recommended to compare it with the Comparison table below.

SELECTED_OUTPUT
    -file ex5.txt
    -pH true
    -molalities Ca+2 Mg+2
    -saturation_indices Calcite Dolomite

Comparison of Results Across Steps

Step pH Ca²⁺
(mmol/kg)
Mg²⁺
(mmol/kg)
SI Calcite SI Dolomite
S1 Groundwater 7.29 1.60 0.00 0.00
S2 Seawater 8.22 9.96 49.7 0.78 2.45
S3 Mixed Water 7.32 4.05 14.8 −0.12 ! 0.47
S4 +Cal+Dol 7.04 11.1 7.85 0.00 0.00
S5 +Cal Only 7.43 4.09 14.8 0.00 0.71

Notice S3 (Mixed Water): Calcite SI = −0.12 — This is the signature of mixing corrosion. Even though the two end-members (S1 and S2) were saturated or supersaturated with calcite, the resulting mixture has a negative SI (undersaturated).


Discussion

1. Mechanism of Mixing Corrosion

The essence of mixing corrosion lies in the non-linearity of carbonate equilibria.

When you mix fresh groundwater (low salinity, low pH, high \(P_{CO_2}\)) with seawater (high salinity, high pH, low \(P_{CO_2}\)): - The increased salinity raises the ionic strength, which lowers the activity coefficients (\(\gamma\)) of the ions. - The balance between pH and \(P_{CO_2}\) shifts non-linearly. - Consequently, the mixture becomes undersaturated with respect to calcite.

Understanding via the Mixing Corrosion Equation
SI = log(IAP / Ksp)
IAP = a(Ca²⁺) × a(CO₃²⁻) = γ(Ca²⁺)·[Ca²⁺] × γ(CO₃²⁻)·[CO₃²⁻]

Mixing increases ionic strength → γ decreases → IAP decreases → SI drops below zero.
  • \(SI\): Saturation Index \([-]\)
  • \(IAP\): Ion Activity Product \([-]\)
  • \(K_{sp}\): Solubility Product \([-]\)
  • \(a(i)\): Chemical activity of ion \(i\) \([-]\)
  • \(\gamma(i)\): Activity coefficient of ion \(i\) \([-]\)
  • \([i]\): Molal concentration of ion \(i\) \([mol/kg]\)

2. S4 vs S5 (The Impact of Dolomite)

In S4 (Calcite + Dolomite), \(\mathrm{Mg^{2+}}\) is consumed to precipitate dolomite, which forces \(\mathrm{Ca^{2+}}\) into solution (a process called dolomitization: replacement of Ca with Mg). In S5 (Calcite only), \(\mathrm{Mg^{2+}}\) remains unchanged, and only calcite dissolution occurs.

The fact that the Dolomite SI remains at 0.71 (supersaturated) in S5 reflects the reality that it is kinetically hindered from precipitating.

3. Geological and Environmental Significance

TipWhere Does Mixing Corrosion Occur?

Mixing corrosion plays a pivotal role in various environments: - Coastal Limestone Aquifers: Dissolution of calcite in the transition zone where groundwater meets the saltwater wedge increases aquifer porosity. - Speleogenesis (Cave Formation): Caves often expand at the intersection of two distinct water flow paths with different \(P_{CO_2}\) values. - Petroleum Reservoir Diagenesis: Dissolution of carbonate cements in zones where ancient marine and meteoric waters mixed.


Summary of New PHREEQC Commands

MIX
Physically mixes two solutions at a specified ratio.
SAVE
Stores the computed solution state into memory.
USE
Recalls a saved solution for subsequent reactions.
EQUILIBRIUM_PHASES
Reacts the solution until mineral equilibrium is reached.

Next Time: Pyrite Oxidation

In the next tutorial, we step into Irreversible Reactions. We will simulate the process of pyrite (\(\mathrm{FeS_2}\)) oxidizing in the presence of oxygen—the fundamental mechanism behind Acid Mine Drainage (AMD). We will tackle more advanced modeling by combining EQUILIBRIUM_PHASES with the REACTION block.


References

Appelo, CAJ, and Dieke Postma. 2005. Geochemistry, Groundwater and Pollution. Second. Balkema, Rotterdam, p. 634.
Parkhurst, David L, and CAJ Appelo. 2013. Description of Input and Examples for PHREEQC Version 3—a Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations. US Geological Survey Techniques; Methods, book 6, chap. A43, 497 p.
Yamamoto, S. 1983. Method of the Groundwater Survey. Kokon Shoin, Tokyo (in Japanese), 490 p.
Yang, Heejun, T Mishima, S Katazakai, and M Kagabu. 2023. “Analytical Approach Using a Chemical Equilibrium Formula and Geochemical Modeling for Alkalinity Measurements of Small Natural Water Samples.” Applied Geochemistry 148: 105535.

Other articles in this series:


DeepFlow | Science beneath the surface